/*
 *   Clovis
 *   Copyright (C) 2008 SFWOL
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef __CINTEGER_H
#define __CINTEGER_H

#include <string>
#include <iostream>
#include <sstream>
#include "ClovisVariable.h"
#include "CString.h"
#include "CFloat.h"
#include "../io/Log.h"

namespace clovis {

	namespace core {

		class CFloat;
		class CString;

		class CInteger : public ClovisVariable {

            private:

                int value;	// Internal value
                int get();	// Method to call the internal value of a CInteger

            public:

				/*!
				 * Objected oriented constructor
				 * \code
				 * CInteger my_var(10);
				 * \endcode
				 */
                CInteger(int value);

                /*!
                 * Constructeur ou l'on souhaite attribuer un nom
                 * \arg Le nom de l'objet
                 * \arg La valeur de l'objet
                 */
                CInteger(std::string name , int value);

   				/*!
				 * Standard type constructor
				 * \code
				 * CInteger my_var = 10;
				 * \endcode
				 */
				CInteger();

				/*!
				 * Get The class type in a std::string variable.
				 * \return "CInteger"
				 */
				std::string getClass();

				/*!
				 * To change the value with a standard int
				 * \arg value The value to assign
				 */
				void operator = (int value);


				/*!
				 * To change the value with a CInteger
				 * \arg value The value to assign
				 */
				void operator = (CInteger value);

				/*!
				 * + operator
				 * \return A new CInteger where th internal value is the sum of the current CInteger and the 'value' argument
				 */
				CInteger operator + (CInteger value);

				/*!
				 * ++var operator
				 * \return A new CInteger where th internal value is the sum of the current CInteger and the 'value' argument
				 */
				void operator ++ ();

				/*!
				 * var++ operator
				 * \return A new CInteger where th internal value is the sum of the current CInteger and the 'value' argument
				 */
				CInteger operator ++ (int value);

				/*!
				 * - operator
				 * \return A new CInteger where th internal value is the substraction of the current CInteger and the 'value' argument
				 */
				CInteger operator - (CInteger value);

				/*!
				 * --var operator
				 * \return A new CInteger where th internal value is the sum of the current CInteger and the 'value' argument
				 */
				void operator -- ();

				/*!
				 * var-- operator
				 * \return A new CInteger where th internal value is the sum of the current CInteger and the 'value' argument
				 */
				CInteger operator -- (int value);

				/*!
				 * + operator
				 * \return A new CInteger where th internal value is the multiplication of the current CInteger and the 'value' argument
				 */
				CInteger operator * (CInteger value);

				/*!
				 * + operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				CInteger operator / (CInteger value);

				/*!
				 * > operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator > (CInteger value);

				/*!
				 * >= operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator >= (CInteger value);

				/*!
				 * > operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator < (CInteger value);

				/*!
				 * >= operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator <= (CInteger value);

				/*!
				 * + operator
				 * \return A new CInteger where th internal value is the sum of the current CInteger and the 'value' argument
				 */
				CInteger operator + (int value);

				/*!
				 * - operator
				 * \return A new CInteger where th internal value is the substraction of the current CInteger and the 'value' argument
				 */
				CInteger operator - (int value);

				/*!
				 * + operator
				 * \return A new CInteger where th internal value is the multiplication of the current CInteger and the 'value' argument
				 */
				CInteger operator * (int value);

				/*!
				 * + operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				CInteger operator / (int value);

				/*!
				 * > operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator > (int value);

				/*!
				 * >= operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator >= (int value);

				/*!
				 * > operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator < (int value);

				/*!
				 * >= operator
				 * \return A new CInteger where th internal value is the division of the current CInteger and the 'value' argument
				 */
				bool operator <= (int value);

				/*!
				 * != operator
				 */
				bool operator != (int value);

				/*!
				 * != operator
				 */
				bool operator != (CInteger value);

				/*!
				 * Convert the current CInteger to a standard integer (int)
				 * \return The converted versionof the current CInteger.
				 */
				int toInt();

                /*!
				 * Convert the current CInteger to a CString.
				 * \return The converted version of the current CInteger.
				 */
				std::string toString();

				/*!
				 * Get a CString representation of the current value.
				 * \return The current value as a CString variable.
				 */
				CString toCString();

				/*!
				 * Get the current value as a CFloat.
				 * \return A CFloat corresponding to the current value.
				 */
				CFloat toCFloat();

		};

	};

};

#endif

